#pragma once

#include <vector>
#include <hash_map>
#include "Type.h"
using namespace stdext;
using namespace std;

class Next {
	private:
		hash_map<Type::Index::Line,vector<Type::Index::Line>> nextRelation;
		hash_map<Type::Index::Line,vector<Type::Index::Line>> revertNextRelation;
		bool bitMapSetFlag;
		vector<vector<bool>> nextBitMap;
	public:
		Next(void);
		~Next(void);

		virtual bool setNext(Type::Index::Line, Type::Index::Line);
		virtual Type::List::Line getSuccessor(Type::Index::Line);
		virtual Type::List::Line getPredecessor(Type::Index::Line);
		virtual bool isNext(Type::Index::Line, Type::Index::Line);
		virtual bool hasSuccessor(Type::Index::Line);
		virtual bool hasPredecessor(Type::Index::Line);
		
		//return true if the bitMap is set correctly
		virtual bool setNextBitMap(vector<vector<bool>>);
		bool isBitMapSet();
};